package com.oversea.service.impl;

import org.hibernate.Query;
import com.oversea.models.User;
import com.oversea.service.UserService;

public class UserServiceImpl extends CommonServiceImpl<User> implements
		UserService {

	public User getUserByName(String name) {
		String hql = "from User where deleted = ? and userName like '%"
				+ name + "'%";
		Query query = getSession().createQuery(hql);
		query.setBoolean(0, false);
		query.setString(1, name);
		return (User) query.uniqueResult();
	}

}
